 % define the map structure:
    projectionType = 'mollweid';
    mapstruct = defaultm(projectionType);
    mapstruct.angleunits = 'degrees';
    mapstruct.origin = [0 0 0];
    mapstruct.falseeasting = 0;
    mapstruct.falsenorthing = 0;
    mapstruct.scalefactor = 1;
    
    % load the worldmap coastlines:
    load coast;
    [xc, yc] = mfwdtran(mapstruct, lat, long);
    
  %Plot log 10(rmax_coher.HLV) as a Mollweide projection  
   
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    figure(6); clf; 
    subplot 211
    	xproject( skyPositions, log10(rmax_coher.HLV), projectionType );
    	maxVal = max(rmax_coher.HLV);
    	minVal = min(rmax_coher.HLV);
    	avgVal = mean(rmax_coher.HLV);

	caxMin = min([ log10(rmax_coher.HLVI); log10(rmax_coher.HLV)]);
	caxMax = max([ log10(rmax_coher.HLVI); log10(rmax_coher.HLV)]);

    	hold on;
    	plot(xc, yc, 'k-', 'LineWidth', 0.2);
    
    	% Plot the locations of all the detectors on top of this
    	for j=1:4
       		det = LoadDetectorData( detNames{j} );
       		[x, y] = mfwdtran(mapstruct, det.phi, det.lambda);
       		plot( x, y, 'mo', 'MarkerFaceColor', 'm', 'MarkerSize', 8);
    	end
    	hold off;
    	colorbar;
    	caxis([caxMin caxMax]);
    
    	xlabel('\phi / rad', 'FontSize', 14);
    	ylabel('\theta / rad', 'FontSize', 14);
    	titleText = sprintf('log_{10}(r_{max} / Mpc) in a coherent search (HLV)--aaa \n Min=%.2f Max = %.2f Mean = %.2f', minVal, maxVal, avgVal)
    	title(titleText, 'FontSize', 12);
    	set(gca, 'FontSize', 12);
    	box on;

    subplot 212
    	xproject( skyPositions, log10(rmax_coher.HLVI), projectionType ); 
    	maxVal = max(rmax_coher.HLVI);
    	minVal = min(rmax_coher.HLVI);
    	avgVal = mean(rmax_coher.HLVI);

    	hold on;
    	plot(xc, yc, 'k-', 'LineWidth', 0.2);
    
    	% Plot the locations of all the detectors on top of this
    	for j=1:4
       		det = LoadDetectorData( detNames{j} );
       		[x, y] = mfwdtran(mapstruct, det.phi, det.lambda);
       		plot( x, y, 'mo', 'MarkerFaceColor', 'm', 'MarkerSize', 8);
    	end
    	hold off;
    	colorbar;
    	caxis([caxMin caxMax]);
    	xlabel('\phi / rad', 'FontSize', 14);
    	ylabel('\theta / rad', 'FontSize', 14);
    	titleText = sprintf('log_{10}(r_{max} / Mpc) in a coherent search (HLVI)--aaaa\n Min=%.2f Max = %.2f Mean = %.2f', minVal, maxVal, avgVal)
    	title(titleText, 'FontSize', 12);
    	set(gca, 'FontSize', 12);
    	box on;
    print('-dpng', 'rmax_coher_aaaa.png')
   
    
    
  % Plot coher_f_ratio as a Mollweide projection
  
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    figure(7); clf; 
    xproject( skyPositions, coher_f_ratio , projectionType ); 
    maxVal = max(coher_f_ratio);
    minVal = min(coher_f_ratio);
    avgVal = mean(coher_f_ratio);
    

    hold on;
    plot(xc, yc, 'c-', 'LineWidth', 0.2);
    
    % Plot the locations of all the detectors on top of this
    for j=1:4
       det = LoadDetectorData( detNames{j} );
       [x, y] = mfwdtran(mapstruct, det.phi, det.lambda);
       plot( x, y, 'mo', 'MarkerFaceColor', 'm', 'MarkerSize', 8);
    end
    hold off;
    colorbar;
    caxis([minVal, maxVal]);
    xlabel('\phi / rad', 'FontSize', 14);
    ylabel('\theta / rad', 'FontSize', 14);
    titleText = sprintf('Improvement of the network in a coherent search--aaaa\n Min=%.2f Max = %.2f Mean = %.2f', minVal, maxVal, avgVal)
    title(titleText, 'FontSize', 12);
    set(gca, 'FontSize', 12);
    box on;
    print('-dpng', 'coher_f_ratio_aaaa.png')
    
